package cn.nexd.app.config.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by wangxu on 16/2/24.
 */
public class Mall implements Parcelable{
    private String mallName;
    private String mallId;
    private boolean isSelected = false;


    public String getMallName() {
        return mallName;
    }

    public void setMallName(String mallName) {
        this.mallName = mallName;
    }

    public String getMallId() {
        return mallId;
    }

    public void setMallId(String mallId) {
        this.mallId = mallId;
    }

    public boolean isSelected() {
        return isSelected;
    }

    public void setIsSelected(boolean isSelected) {
        this.isSelected = isSelected;
    }

    protected Mall(Parcel in) {
        mallName = in.readString();
        mallId = in.readString();
        isSelected = in.readByte() != 0;
    }

    public Mall(String mallId, String mallName) {
        this.mallId = mallId;
        this.mallName = mallName;
    }

    public static final Creator<Mall> CREATOR = new Creator<Mall>() {
        @Override
        public Mall createFromParcel(Parcel in) {
            return new Mall(in);
        }

        @Override
        public Mall[] newArray(int size) {
            return new Mall[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(mallName);
        dest.writeString(mallId);
        dest.writeByte((byte) (isSelected ? 1 : 0));
    }
}
